package com.qs.education.service.impl;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import com.qs.education.bean.api.ResponseBean;
import com.qs.education.bean.api.ResponseListBean;
import com.qs.education.bean.beans.EducationTeacherResponse;
import com.qs.education.bean.entity.EducationTeacher;
import com.qs.education.bean.service.BaseService;
import com.qs.education.service.ITeacherAPPService;

/**
 * @class TeacherAPPServiceImpl
 * @author Leon
 * @description
 * @date Nov 1, 2018
 */
@Service
public class TeacherAPPServiceImpl extends BaseService implements ITeacherAPPService {

	@Override
	public EducationTeacherResponse findTeacherByMobile(String mobile) {
		EducationTeacherResponse educationTeacherResponse = apiCaller.findEducationTeacherByMobile(mobile);
		return educationTeacherResponse;
	}

	@Override
	public EducationTeacherResponse login(String mobile, String password) {
		EducationTeacherResponse educationTeacherResponse = apiCaller.login(mobile,password);
		return educationTeacherResponse;
	}

	@Override
	public EducationTeacherResponse Quit(String mobile) {
		EducationTeacherResponse educationTeacherResponse = apiCaller.quit(mobile);
		return educationTeacherResponse;
	}

	@Override
	public EducationTeacherResponse ForgetPassword(String mobile,String password) {
		EducationTeacherResponse educationTeacherResponse = apiCaller.ForgetPassword(mobile,password);
		return educationTeacherResponse;
	}

	@Override
	public EducationTeacherResponse saveTeacherMobileAndPassword(String mobile, String password) {
		EducationTeacherResponse educationTeacherResponse = apiCaller.saveTeacherMobileAndPassword(mobile, password);
		return educationTeacherResponse;
	}

	@Override
	public EducationTeacherResponse perfectTeacherInfo(EducationTeacher teacher,String schoolId,String subjectId) {
		EducationTeacherResponse educationTeacherResponse = apiCaller.perfectTeacherInfo(teacher,schoolId,subjectId);
		return educationTeacherResponse;
	}

	@Override
	public ResponseListBean<EducationTeacher> findTeacherByMobileOrName(String content) {
		ResponseListBean<EducationTeacher> list = apiCaller.findTeacherByMobileOrName(content);
		return list;
	}

	@Override
	public EducationTeacherResponse modifyTeacherInfo(HttpServletRequest request,EducationTeacher teacher,MultipartFile file) {
		EducationTeacherResponse response = apiCaller.modifyTeacherInfo(request,teacher,file);
		return response;
	}

	@Override
	public ResponseBean quitGroup(String groupId, String teacherId) {
		ResponseBean response = apiCaller.quitGroup(groupId, teacherId);
		return response;
	}

	@Override
	public ResponseBean changePassword(String id,String oldPassword, String newPassword) {
		ResponseBean response = apiCaller.changePassword(id,oldPassword, newPassword);
		return response;
	}

	@Override
	public EducationTeacherResponse findTeacherById(String teacherId) {
		EducationTeacherResponse response = apiCaller.findTeacherById(Integer.parseInt(teacherId));
		return response;
	}
}
